import Backdrop from '../Backdrop/Backdrop'

import classes from './Confirm.module.css'


const Confirm = ({ onCancel, onConfirm, confirmText }) => {

	console.log('confirm')
	return (
		<Backdrop
			className={classes.Confirm}
			onClick={(e) => { onCancel(e) }}
		>
			<div className={classes.ConfirmBox}>
				<h1 className={classes.Title}>
					{confirmText}
				</h1>
				<div className={classes.ButtonsBox}>
					<button
						className={classes.Button}
						onClick={(e) => { onCancel(e) }}
					>
						Cancel
					</button>
					<button
						className={classes.Button + ' ' + classes.ConfirmButton}
						onClick={() => { onConfirm() }}
					>
						Confirm
					</button>
				</div>
			</div>
		</Backdrop>
	)
}

export default Confirm